package cn.iocoder.yudao.module.trade.enums;

import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import java.util.Arrays;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 应用 - 类型
 *
 * @author Cai
 */
@RequiredArgsConstructor
@Getter
public enum ApplicationNameEnum implements IntArrayValuable {

    CDK_MALL(1, "MallApiServer"),
    ESIM_MALL(2, "ESimApiServer"),
    ;

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ApplicationNameEnum::getType).toArray();

    /**
     * 类型
     */
    private final Integer type;
    /**
     * 类型名
     */
    private final String name;

    @Override
    public int[] array() {
        return ARRAYS;
    }

    public static boolean isCDK(String name) {
        return ObjectUtil.equal(name, CDK_MALL.getName());
    }

    public static boolean isESIM(String name) {
        return ObjectUtil.equal(name, ESIM_MALL.getName());
    }


}
